package 图片处理;

import java.util.concurrent.*;

/**
 * @author zhaozeyang
 * @date 2018/11/8 16:27
 * @description
 */
public class main {

    final static ExecutorService executorService=new ThreadPoolExecutor(32,64,60L,TimeUnit.SECONDS,new LinkedBlockingQueue<Runnable>(),new PicRejectedExecutionHandler());
   // final static ExecutorService executorService=Executors.newCachedThreadPool();
    public static void main(String[] args) throws InterruptedException {
        final int num = 1000;
        CountDownLatch countDownLatch = new CountDownLatch(num);
        for (int i = 0; i < num; i++) {
            executorService.execute(new PicTask("https://static-xesapi.speiyou.cn/1541659216260.jpg",countDownLatch,i));
        }
        countDownLatch.await();
        System.out.println("over");
    }
}
